/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.za.cput.kleintjes.question3.ocp.violates.services.impl;

import ac.za.cput.kleintjes.question3.ocp.violates.model.Member;
import ac.za.cput.kleintjes.question3.ocp.violates.model.MemberGold;
import ac.za.cput.kleintjes.question3.ocp.violates.model.MemberSilver;
import ac.za.cput.kleintjes.question3.ocp.violates.model.MemberStandard;
import ac.za.cput.kleintjes.question3.ocp.violates.services.IMember;

/**
 *
 * @author Administrator
 */
public class MemberFee implements IMember{
    
    public double calculateFee(Member member)
    {
        double total = 0.00;
        if(member.getType().equals("Standard"))
        {
            MemberStandard memberStd = (MemberStandard) member;
            total = memberStd.getBasicAmount();
        }
        else if(member.getType().equals("Silver"))
        {
            MemberSilver memberSilver = (MemberSilver) member;
            total = memberSilver.getBasicAmount()+ 
                    memberSilver.getParkingFee();
        }
        else if(member.getType().equals("Gold"))
        {
            MemberGold memberGold = (MemberGold) member;
            total = memberGold.getBasicAmount()+ 
                    memberGold.getParkingFee()+ 
                    memberGold.getPrivateClassFee();
        }    
        return total;
    }
}
